package com.crm.model.jdao;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.crm.model.pojo.QuotationDetail;
import com.crm.model.pojo.QuotationRecord;

public interface IQuotationDetailDAO extends CrudRepository<QuotationDetail,Integer>{

	/**
	 * 带条件的分页，查询所有报价明细
	 * @param <T>
	 * @return
	 * 
	 */
 
 Page<QuotationDetail> findAll(Specification<QuotationDetail> spec,Pageable pageable);
  
  /**
   * 统计对象个数
   */
  long count();
  
  /**
   * 根据id查询报价明细
   * @param salId
   * @return
   */
  //QuotationDetail findByQd_recordId(Integer qd_recordId);
  @Query("SELECT q FROM QuotationDetail q where q.qdDetailId=?1")
  QuotationDetail queryByqdDetailId(Integer qdDetailId);
  
  /**
   * 通过报价单查询报价单明细
   * @param quotationRecord
   * @return
   */
  List<QuotationDetail> findByQuotationRecord(QuotationRecord quotationRecord);
  
}
